{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">API管理</li>
            <li class=""><a href="{:url('admin/api/add')}">添加API</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>API版本</th>
                        <th>API地址</th>
                        <th>API描述</th>
                        <th>是否禁用</th>
                        <th>是否公用API</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="api_list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.apiVersion.name}</td>
                        <td>{$vo.api_url}</td>
                        <td>{$vo.api_description}</td>
                        <td>{if condition="$vo.is_status==1"} <span class="layui-btn layui-btn-normal layui-btn-mini">启用</span> {else /}<span class="layui-btn layui-btn-danger layui-btn-mini">禁用</span>{/if}</td>
                        <td>{if condition="$vo.is_public==1"} <span class="layui-btn layui-btn-normal layui-btn-mini">私有</span> {else /}<span class="layui-btn layui-btn-danger layui-btn-mini">公用</span>{/if}</td>
                        <td>
                            <a href="{:url('admin/api/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                            <a href="{:url('admin/api/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{/block}